using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace SPGE
{
    public class ColorBackground : ABackground
    {
        public Color BackgroundColor
        {get;set;}

        public override string Path
        { get; protected set; }

        public ColorBackground(Color color)
            : base()
        {
            SpriteUse = SpriteBatchUse.AlreadyBeganSpriteBatch;
            BackgroundColor = color;
        }

        public override void Initialize()
        { }

        public override void Load(ResourceGroupHandler group)
        {
            Texture = new Microsoft.Xna.Framework.Graphics.Texture2D(GameContainer.Device, 1, 1, false, Microsoft.Xna.Framework.Graphics.SurfaceFormat.Color);

            Texture.SetData<Color>(new Color[] { Color.White });
        }

        public override void Draw(GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Texture, new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y), null, BackgroundColor,0, Vector2.Zero, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, RenderLevel);
        }
    }
}
